const axios = require('axios')
let _baseUrl = '/gateway/business/api'

// 查询全部队伍
export function getTeamList () {
  const url = _baseUrl + '/team/getTeamList'
  return axios.post(url).then((res) => {
    return Promise.resolve(res.data)
  })
}

// 团队详情
export function getTeamDetail (data) {
  const url = _baseUrl + '/team/getTeamDetail'
  return axios.post(url, data).then((res) => {
    return Promise.resolve(res.data)
  })
}

// 查询队伍人员
export function getMemberDetail (data) {
  const url = _baseUrl + '/team/getMemberDetail'
  return axios.post(url, data).then((res) => {
    return Promise.resolve(res.data)
  })
}

// 解散团队
export function disbandTeam (data) {
  const url = _baseUrl + '/team/disbandTeam'
  return axios.post(url, data).then((res) => {
    return Promise.resolve(res.data)
  })
}

// 修改团队简介
export function updateTeamIntro (data) {
  const url = _baseUrl + '/team/updateTeamIntro'
  return axios.post(url, data).then((res) => {
    return Promise.resolve(res.data)
  })
}

// 删除成员
export function deleteMember (data) {
  const url = _baseUrl + '/team/deleteMember'
  return axios.post(url, data).then((res) => {
    return Promise.resolve(res.data)
  })
}

// 通知修改
export function updateNotice (data) {
  const url = _baseUrl + '/team/updateNotice'
  return axios.post(url, data).then((res) => {
    return Promise.resolve(res.data)
  })
}

// 创建团队
export function creatPaiTeam (data) {
  const url = _baseUrl + '/team/creatPaiTeam'
  return axios.post(url, data).then((res) => {
    return Promise.resolve(res.data)
  })
}

// 发送邮箱邀请链接
export function sendTeamMemberEmail (data) {
  const url = _baseUrl + '/team/sendTeamMemberEmail'
  return axios.post(url, data).then((res) => {
    return Promise.resolve(res.data)
  })
}

// 加入团队
export function addTeamMemberByUrl (data) {
  const url = _baseUrl + '/team/addTeamMemberByUrl'
  return axios.post(url, data).then((res) => {
    return Promise.resolve(res.data)
  })
}

// 推出团队
export function quitTeam (data) {
  const url = _baseUrl + '/team/quitTeam'
  return axios.post(url, data).then((res) => {
    return Promise.resolve(res.data)
  })
}

// 验证邮箱
export function getUserInfoByEmail (data) {
  const url = _baseUrl + '/team/getUserInfoByEmail'
  return axios.post(url, data).then((res) => {
    return Promise.resolve(res.data)
  })
}

// 邀请团队成员点击
export function checkUrlData (data) {
  const url = _baseUrl + '/team/checkUrlData'
  return axios.post(url, data).then((res) => {
    return Promise.resolve(res.data)
  })
}
